﻿<UserControl x:Class="Collab.Modules.ContactBrowser.View.LoginView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:helpers="clr-namespace:Collab.Modules.ContactBrowser.Helpers"
             mc:Ignorable="d" 
             d:DesignHeight="169" d:DesignWidth="405">
        <Grid Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="10" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!-- Username -->
            <TextBlock Text="Username: "
            Grid.Row="0" Grid.Column="0" Padding="0,5,5,5" />

            <TextBox Text="{Binding Path=Username, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch"
            Grid.Row="0" Grid.Column="2" Name="tbUsername" />

            <!-- Password -->
            <TextBlock Text="Password: " 
            Grid.Row="2" Grid.Column="0" Padding="0,5,5,5" />

            <PasswordBox HorizontalAlignment="Stretch"
                        PasswordChar="*"
                        helpers:PasswordBoxAssistant.BindPassword="true"
                        helpers:PasswordBoxAssistant.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                        
            Grid.Row="2" Grid.Column="2" Name="tbPassword" />

            <!-- Submit -->
            <Button Content="Login" HorizontalAlignment="Center" Width="100"  Command="{Binding LoginCommand}"
            Grid.Row="3" Grid.ColumnSpan="3" Margin="0,10,0,0" />

        </Grid>
</UserControl>
